﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Httlgd.DataCenter.Services.Core;
using Httlgd.DataCenter.Services.Sms.DataTransferObject;
using Httlgd.DataCenter.Services.Sms.BusinessComponent;
using Httlgd.DataCenter.Services.Core.Common.Service;
using System.ServiceModel;

namespace Httlgd.DataCenter.Services.Sms.ServiceLibrary
{
    [ServiceBehavior]
    public class SermonService : ISermonService
    {
        #region ISermonService Members

        public List<SermonDTO> RetrieveAllSermon()
        {
            SermonBC bc = new SermonBC();
            return null;
        }

        public SermonDTO RetrieveSermon(int id)
        {
            SermonBC bc = new SermonBC();
            return BusinessService.Execute<DTOKey, SermonDTO>(new DTOKey(id), bc.Retrieve);
        }

        public DataTransferObjectCollectionBase<SermonDTO> SearchSermon(SermonSearchParameterDTO param)
        {
            SermonBC bc = new SermonBC();
            return BusinessService.Execute<SermonSearchParameterDTO, DataTransferObjectCollectionBase<SermonDTO>>(param, bc.Search);
        }

        public SermonDTO SaveSermon(SermonDTO sermon)
        {
            SermonBC bc = new SermonBC();
            return BusinessService.Execute<SermonDTO, SermonDTO>(sermon, bc.Save);
        }

        public void DeleteSermon(int id)
        {
            SermonBC bc = new SermonBC();
            BusinessService.Execute<DTOKey>(new DTOKey(id), bc.Delete);
        }

        #endregion
    }
}
